from django.contrib import admin

from .models import *

# Register your models here.


admin.site.site_title = "新闻网站管理系统"
admin.site.site_header = "新闻网站管理系统"
admin.site.index_title = "新闻网站管理系统"


class UserManager(admin.ModelAdmin):
    # 列表页显示那些字段
    list_display = ['id', 'name', 'phone', 'email', 'password', 'time', 'is_active', 'time', 'admin_sample']


class NewsManager(admin.ModelAdmin):
    # 列表页显示那些字段
    list_display = ['id', 'title', 'type', 'traffic','is_active', 'time', 'admin_sample']


class TypeManager(admin.ModelAdmin):
    # 列表页显示那些字段
    list_display = ['id', 'type', 'is_active', 'time']


class MessageManager(admin.ModelAdmin):
    # 列表页显示那些字段
    list_display = ['id', 'user', 'news', 'is_active', 'time', 'admin_sample']


class MyHref1Manager(admin.ModelAdmin):
    # 列表页显示那些字段
    list_display = ['id', 'title', 'is_active', 'time', 'admin_sample']


class HrefManager(admin.ModelAdmin):
    # 列表页显示那些字段
    list_display = ['id', 'title', 'href', 'is_active', 'time', 'admin_sample']


class AdmirationManager(admin.ModelAdmin):
    # 列表页显示那些字段
    list_display = ['id', 'title', 'is_active', 'time', 'admin_sample']


admin.site.register(User, UserManager)
admin.site.register(News, NewsManager)
admin.site.register(Type, TypeManager)
admin.site.register(Message, MessageManager)
admin.site.register(MyHref1, MyHref1Manager)
admin.site.register(Href, HrefManager)
admin.site.register(Admiration, AdmirationManager)
